<?php
$this->breadcrumbs = array('Kota');
?>

<h1><?php echo 'Daftar Nama dan Alamat Pengurus SENKOM Mitra POLRI'; ?></h1>

<?php foreach ($models as $model): ?>
	<h2>
		<?php echo $model->name; ?>
	</h2>

	<?php
	$baseUrl = Yii::app()->request->baseUrl . '/images/fugue';
	$properties = array(
		'items'=>array(
			array(
				'label'=>"Ubah",
				'url'=>array('province/update', 'id'=>$model->_id),
				'linkOptions'=>array('title'=>'Ubah'),
			),
		),
		'htmlOptions'=>array(
			'class'=>'actions',
		),
		'encodeLabel'=>false,
	);
	$this->widget('zii.widgets.CMenu', $properties);
	?>

	<?php
	$data = array('data'=>$model);
	$this->renderPartial('application.views.province._viewMin', $data);
	$pagination = array('pageSize'=>1000);
	$config = array('id'=>'city', 'keyField'=>'_id', 'pagination'=>$pagination);
	$dataProvider = new CArrayDataProvider($model->cities, $config);
	$properties = array(
		'dataProvider'=>$dataProvider,
		'enablePagination'=>false,
		'pager'=>false,
		'summaryText'=>'',
		'id'=>'city-list',
		'columns'=>array(
			array(
				'header'=>'Kota/Kab',
				'value'=>'$data->type . " " . $data->name',
			),
			array(
				'header'=>'Nama Ketua',
				'value'=>'$data->chiefName',
			),
			array(
				'header'=>'Alamat Ketua',
				'type'=>'raw',
				'value'=>'$data->chiefAddress',
			),
			array(
				'header'=>'Telepon Ketua',
				'value'=>'$data->chiefPhones',
			),
			array(
				'header'=>'Email Resmi',
				'value'=>'$data->emails',
			),
			array(
				'class'=>'CButtonColumn',
				'updateButtonLabel'=>'Ubah',
				'updateButtonUrl'=>'array("city/update", "id"=>"$data->_id")',
				'updateButtonImageUrl'=>false,
				'template'=>'{update}',
			)
		),
	);
	$this->widget('zii.widgets.grid.CGridView', $properties);
	?>
<?php endforeach; ?>
